package cn.six.dosomething408;

import cn.six.dosomething408.service.UserService;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo1 {
    @Test
    public void run1(){
// 使用 Spring 的工厂
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
// 通过工厂获得类:
        UserService userService = (UserService)
                applicationContext.getBean("userService");
        userService.hello();
    }

}
